﻿using Sidvall.Serialization;

namespace Sidvall.WorkItemManager.Configuration
{
    public static partial class SettingsManager
    {
        #region Public Members

        #region ConfigFilePath

        public static System.String ConfigFilePath
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(ConfigFilePath)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(ConfigFilePath), value);
            }
        }

        #endregion
        #region ProcessType

        public static Sidvall.WorkItemManager.Data.ProcessType ProcessType
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(ProcessType)).ToString(null).ToEnum(Sidvall.WorkItemManager.Data.ProcessType.Server);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(ProcessType), value);
            }
        }

        #endregion
        #region VersionFilePath

        public static System.String VersionFilePath
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(VersionFilePath)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(VersionFilePath), value);
            }
        }

        #endregion
        #region CurrentVersion

        public static System.String CurrentVersion
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(CurrentVersion)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(CurrentVersion), value);
            }
        }

        #endregion
        #region TwoFactorProvider

        public static Sidvall.Security.TwoFactorProvider TwoFactorProvider
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(TwoFactorProvider)).ToString(null).ToEnum(Sidvall.Security.TwoFactorProvider.None);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(TwoFactorProvider), value);
            }
        }

        #endregion
        #region ApplicationTitle

        public static System.String ApplicationTitle
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(ApplicationTitle)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(ApplicationTitle), value);
            }
        }

        #endregion
        #region AuthorizationScopeId

        public static System.Nullable<System.Int64> AuthorizationScopeId
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(AuthorizationScopeId)).ToString(null).ToNullableInt64();
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(AuthorizationScopeId), value);
            }
        }

        #endregion
        #region AuthorizationManagerConnectionString

        public static System.String AuthorizationManagerConnectionString
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(AuthorizationManagerConnectionString)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(AuthorizationManagerConnectionString), value);
            }
        }

        #endregion
        #region AuthorizationCachePolicy

        public static System.Nullable<System.Int32> AuthorizationCachePolicy
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(AuthorizationCachePolicy)).ToString(null).ToNullableInt32();
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(AuthorizationCachePolicy), value);
            }
        }

        #endregion
        #region STSBaseAddress

        public static System.String STSBaseAddress
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(STSBaseAddress)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(STSBaseAddress), value);
            }
        }

        #endregion
        #region BaseAddress

        public static System.String BaseAddress
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(BaseAddress)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(BaseAddress), value);
            }
        }

        #endregion
        #region STSClientId

        public static System.String STSClientId
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(STSClientId)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(STSClientId), value);
            }
        }

        #endregion
        #region STSClientSecret

        public static System.String STSClientSecret
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(STSClientSecret)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(STSClientSecret), value);
            }
        }

        #endregion
        #region TwoFactorValidUsers

        public static System.String TwoFactorValidUsers
        {
            get
            {
                return Sidvall.SystemContext.Current.SettingsManager.GetSetting(nameof(TwoFactorValidUsers)).ToString(null);
            }
            set
            {
                Sidvall.SystemContext.Current.SettingsManager.SetSetting(nameof(TwoFactorValidUsers), value);
            }
        }

        #endregion
        
        #endregion
    }
}